<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jstl/core"
                xmlns:sf="http://www.springframework.org/tags/faces"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:spring="http://www.springframework.org/tags"
                template="../../../layout/Template.xhtml">

    <ui:define name="menu">
        <ui:include src="${user.menu}"/>
    </ui:define>

    <ui:define name="title">
        <h:outputText value="#{resourceBundle.updateRemedialWelcome}"/>
    </ui:define>

    <ui:define name="content">
        <ui:fragment id="updateRemedialFragment">
            <rich:panel id="updateRemedialPanel" header="#{resourceBundle.updateRemedialOverview}">
                <h:form id="updateRemedialForm">
                    <h:panelGrid id="updateRemedialGrid" columns="3">
                        <h:outputText value="#{resourceBundle.updateRemedialFormSubject}"/>
                        <h:inputText value="#{flowScope.currentRemedial.subject}"
                                     id="subject"
                                     required="true"
                                     requiredMessage="#{resourceBundle.updateRemedialRequiredMessageSubject}"/>
                        <h:message for="subject" style="color:red"/>

                        <h:outputText value="#{resourceBundle.updateRemedialFormWeight}"/>
                        <h:inputText value="#{flowScope.currentRemedial.weight}"
                                     id="weight"
                                     required="true"
                                     requiredMessage="#{resourceBundle.updateRemedialRequiredMessageWeight}"/>
                        <h:message for="weight" style="color:red"/>

                        <h:outputText value="#{resourceBundle.updateRemedialFormStartTime}"/>
                        <h:inputText value="#{flowScope.currentRemedial.startTime}"
                                     id="startTime"
                                     required="true"
                                     requiredMessage="#{resourceBundle.updateRemedialRequiredMessageStartTime}"
                                     converterMessage="#{resourceBundle.updateRemedialConverterMessageStartTime}">
                            <f:convertDateTime pattern="HH:mm" type="time"/>
                        </h:inputText>
                        <h:message for="startTime" style="color:red"/>

                        <h:outputText value="#{resourceBundle.updateRemedialFormEndTime}"/>
                        <h:inputText value="#{flowScope.currentRemedial.endTime}"
                                     id="endTime"
                                     required="true"
                                     requiredMessage="#{resourceBundle.updateRemedialRequiredMessageEndTime}"
                                     converterMessage="#{resourceBundle.updateRemedialConverterMessageEndTime}">
                            <f:convertDateTime pattern="HH:mm" type="time"/>
                        </h:inputText>
                        <h:message for="endTime" style="color:red"/>

                        <h:outputText value="#{resourceBundle.updateRemedialFormDate}"/>
                        <h:inputText value="#{flowScope.currentRemedial.date}"
                                     id="date"
                                     required="true"
                                     requiredMessage="#{resourceBundle.updateRemedialRequiredMessageDate}"
                                     converterMessage="#{resourceBundle.updateRemedialConverterMessageDate}">
                            <f:convertDateTime pattern="dd/MM/yy" type="date"/>
                        </h:inputText>
                        <h:message for="date" style="color:red"/>

                        <h:outputText value="#{resourceBundle.updateRemedialFormConsultationDate}"/>
                        <h:inputText value="#{flowScope.currentRemedial.consultationDate}"
                                     id="consultationDate"
                                     converterMessage="#{resourceBundle.updateRemedialConverterMessageConsultationDate}">
                            <f:convertDateTime pattern="dd/MM/yy" type="date"/>
                        </h:inputText>
                        <h:message for="consultationDate" style="color:red"/>

                        <h:outputText value="#{resourceBundle.updateRemedialFormConsultationHour}"/>
                        <h:inputText value="#{flowScope.currentRemedial.consultationHour}"
                                     id="consultationHour"
                                     converterMessage="#{resourceBundle.updateRemedialConverterMessageConsultationHour}">
                            <f:convertDateTime pattern="HH:mm" type="time"/>
                        </h:inputText>
                        <h:message for="consultationHour" style="color:red"/>
                    </h:panelGrid>

                    <h:messages globalOnly="true"/>

                    <h:panelGrid id="updateRemedialButtonGrid" columns="2">
                        <a4j:commandButton id="updateRemedialButtonUpdate" value="#{bundle.submitButton}"
                                           action="update"/>

                        <a4j:commandButton id="updateRemedialButtonReturn" value="#{bundle.cancelButton}"
                                           action="cancel"
                                           immediate="true"/>
                    </h:panelGrid>
                </h:form>
            </rich:panel>
        </ui:fragment>
    </ui:define>

</ui:composition>